<?php
/* 采购项 */
class SourcingitemModel extends BaseModel
{
    var $table  = 'sourcing_item';			//表名
    var $prikey = 'item_id';		//主键
    var $_name  = 'sourcingitem';			//查询用表名
	
	//模型关联
    var $_relation = array(
		'belongs_sourcing' => array(
			'model' => 'sourcing',
			'type' => BELONGS_TO,
            'foreign_key'   => 'list_id',
            'reverse'       => 'has_item',
		),
		'belongs_fabric_shop' => array(
			'model' => 'fabric_shop',
			'type' => BELONGS_TO,
            'foreign_key'   => 'fabric_shop_id',
            'reverse'       => 'has_sour_item',
		),
	);
	
}

?>